﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <style type="text/css">
        .container
        {
            width: 100%;
            height: 100%;
        }
    </style>
</head>
<body>
    <div class="container">
        <form id="formdt" action="">
        <input type="file" />
        <input type="button" value="上传" onclick="fnUpload()" />
        </form>
        <form id="my_form" method="post" action="" enctype="multipart/form-data">
        <input type="button" value="下载" onclick="fnDownfile()" />
        </form>
    </div>
    <script type="text/javascript">
        function fnUpload() {
            var formData = new FormData($("#formdt"))[0];
            $.ajax({
                url: '',
                data: formData,
                async: false,
                contentType: false,
                processdata: false,
                sucess: function (res) {
                    alert(res);
                },
                error: function (res) {
                    alert(res.toString());
                }

            });
        }
    </script>
</body>
</html>
